<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="f1()">跳转</button>
    <div></div>
</body>
</html>
<script>
    var div=document.querySelector("div")
    function f1(){
        time=5
        var a=setInterval(function(){
            div.innerHTML=`还有${time--}秒跳转页面`;
            if(time==0){
            location.href='./01.html'
            }
        },1000)
    }
</script>